PagerDuty V2

Parameters

The PagerDuty notification service is used to trigger PagerDuty events and requires specifying the following settings:

  • serviceKeys - a dictionary with the following structure:
  • service-name: $pagerduty-key-service-name where service-name is the name you want to use for the service to make events for, and $pagerduty-key-service-name is a reference to the secret that contains the actual PagerDuty integration key (Events API v2 integration)

If you want multiple Argo apps to trigger events to their respective PagerDuty services, create an integration key in each service you want to setup alerts for.

To create a PagerDuty integration key, follow these instructions to add an Events API v2 integration to the service of your choice.

Configuration

The following snippet contains sample PagerDuty service configuration. It assumes the service you want to alert on is called my-service.

  1. apiVersion: v1
  2. kind: Secret
  3. metadata:
  4. name: <secret-name>
  5. stringData:
  6. pagerduty-key-my-service: <pd-integration-key>
  1. apiVersion: v1
  2. kind: ConfigMap
  3. metadata:
  4. name: <config-map-name>
  5. data:
  6. service.pagerdutyv2: |
  7. serviceKeys:
  8. my-service: $pagerduty-key-my-service

Template

Notification templates support specifying subject for PagerDuty notifications:

  1. apiVersion: v1
  2. kind: ConfigMap
  3. metadata:
  4. name: <config-map-name>
  5. data:
  6. template.rollout-aborted: |
  7. message: Rollout {{.rollout.metadata.name}} is aborted.
  8. pagerdutyv2:
  9. summary: "Rollout {{.rollout.metadata.name}} is aborted."
  10. severity: "critical"
  11. source: "{{.rollout.metadata.name}}"

The parameters for the PagerDuty configuration in the template generally match with the payload for the Events API v2 endpoint. All parameters are strings.

  • summary - (required) A brief text summary of the event, used to generate the summaries/titles of any associated alerts.
  • severity - (required) The perceived severity of the status the event is describing with respect to the affected system. Allowed values: critical, warning, error, info
  • source - (required) The unique location of the affected system, preferably a hostname or FQDN.
  • component - Component of the source machine that is responsible for the event.
  • group - Logical grouping of components of a service.
  • class - The class/type of the event.
  • url - The URL that should be used for the link “View in ArgoCD” in PagerDuty.

The timestamp and custom_details parameters are not currently supported.

Annotation

Annotation sample for PagerDuty notifications:

  1. apiVersion: argoproj.io/v1alpha1
  2. kind: Rollout
  3. metadata:
  4. annotations:
  5. notifications.argoproj.io/subscribe.on-rollout-aborted.pagerdutyv2: "<serviceID for Pagerduty>"